import { createStore, createLogger } from 'vuex'
import { userState } from './modules/user/store'
import { globalState } from './modules/global/store'
import { settingsState } from './modules/settings/store'
import getters from './getters'
import { modules } from './modules'

const debug = process.env.NODE_ENV !== 'production'

export interface StoreState {
  user: userState,
  global: globalState,
  settings: settingsState,
}

const store = createStore<StoreState>({
  modules,
  getters,
  strict: debug,
  plugins: debug ? [createLogger()] : [],
})

export default store;